package com.demo.core.verification;



import com.demo.core.annotation.NotBlank;
import com.demo.core.utils.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author Tan-Bowen
 * @description TODO 不能为空校验器
 * @date 2021/8/12 13:02
 */
public class NotBlankValidator implements ConstraintValidator<NotBlank, String> {

    @Override
    public void initialize(NotBlank constraintAnnotation) {

    }

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return StringUtils.isNotBlank(s);
    }
}
